/**********************************************************************
  The MIT License (MIT)
  Copyright (c) 2012 sunriseyuen

  Permission is hereby granted, free of charge, to any person obtaining
  a copy of this software and associated documentation files
  (the "Software"), to deal in the Software without restriction,
  including without limitation the rights to use, copy, modify, merge,
  publish, distribute, sublicense, and/or sell copies of the Software,
  and to permit persons to whom the Software is furnished to do so,
  subject to the following conditions:

  The above copyright notice and this permission notice shall be included
  in all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
  THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 ***********************************************************************/

#define _DEF_CCY_CODE
#define _ZZDEBUG
#define _PROJ_DC

#region Using directives

using System;
using System.Text;
using System.IO;
using System.Xml;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Reflection;
using System.Web;
using System.Web.UI;

using Muki.Framework;
using Muki.Framework.UI;
using Muki.Framework.Business;
using Muki.Framework.Util;
using Muki.UserDefine;
using Muki.Entity;
using Dot.StreamObject;

using Dot.Tmpl;
using Dot.Tmpl.Parser;

#endregion

namespace Muki.UserPanel
{

	public class UID02805BV
	{
		public UID02805BV()
		{
		}

		public void setValue()
		{

				_lnk_RW_NO=ZZGeneral.XRequest("lnk_RW_NO");
				if (ZZGeneral.XRequest("lnk_UID_CODE_DAT")!="")
				{
					_Wxf = new Wxf();
					_Wxf.Parser(System.Web.HttpUtility.UrlDecode(ZZGeneral.XRequest("lnk_UID_CODE_DAT")));
					_Wxf.Open();

					ZZTrace.WriteToFile(this.APP_PATH+"\\temp\\UID02805B2.js",_Wxf.ToString());
					_lnk_MODE="B";
				}

					_UID02805BEntity.ECN_NO = _Convert.ToString(objECNDTLM_ECN_NO.Text);

					_UID02805BEntity.SERIAL_NO = _Convert.ToInt(objECNDTLM_SERIAL_NO.Text);

					_UID02805BEntity.ECN_DT = _Convert.ToString(objECNDTLM_ECN_DT.Text);
					if (_STATUS_DATA["IsPostBack"]=="")
					{
						if (ZZGeneral.XRequest("lnk_ECNDTLM_ECN_DT")!="")
						{
							_UID02805BEntity.ECN_DT = ZZGeneral.XRequest("lnk_ECNDTLM_ECN_DT");
						}
					}

					_UID02805BEntity.ECN_ATVT_CODE = _Convert.ToString(objECNDTLM_ECN_ATVT_CODE.Text);

					_UID02805BEntity.ASSM_NO = _Convert.ToString(objECNDTLM_ASSM_NO.Text);

					_UID02805BEntity.ASSM_NAME01 = _Convert.ToString(objVARIABLE_ASSM_NAME01.Text);

					_UID02805BEntity.ASSM_UOM = _Convert.ToString(objVARIABLE_ASSM_UOM.Text);

					_UID02805BEntity.ASSM_NAME02 = _Convert.ToString(objVARIABLE_ASSM_NAME02.Text);

					_UID02805BEntity.ITEM_NO = _Convert.ToString(objECNDTLM_ITEM_NO.Text);

					_UID02805BEntity.ITEM_NAME01 = _Convert.ToString(objVARIABLE_ITEM_NAME01.Text);

					_UID02805BEntity.UOM_CODE = _Convert.ToString(objVARIABLE_UOM_CODE.Text);

					_UID02805BEntity.ITEM_NAME02 = _Convert.ToString(objVARIABLE_ITEM_NAME02.Text);

					_UID02805BEntity.ENG_QPE = _Convert.ToDecimal(objECNDTLM_ENG_QPE.Text);

					_UID02805BEntity.UOM_ENG = _Convert.ToString(objECNDTLM_UOM_ENG.Text);

					_UID02805BEntity.UOM_XCHG = _Convert.ToDecimal(objECNDTLM_UOM_XCHG.Text);

					_UID02805BEntity.QTY_PER = _Convert.ToDecimal(objECNDTLM_QTY_PER.Text);

					_UID02805BEntity.SCRAP_RATE = _Convert.ToDecimal(objECNDTLM_SCRAP_RATE.Text);

					_UID02805BEntity.WASTAGE_RATE = _Convert.ToDecimal(objECNDTLM_WASTAGE_RATE.Text);

					_UID02805BEntity.ECN_REFX = _Convert.ToString(objECNDTLM_ECN_REFX.Text);

					_UID02805BEntity.ECN_LOCX = _Convert.ToString(objECNDTLM_ECN_LOCX.Text);

					_UID02805BEntity.ECN_RMKS = _Convert.ToString(objECNDTLM_ECN_RMKS.Text);

		}

		public void getValue()
		{
					_STATUS_DATA["UID02805B","PK_ECN_DT"]=_Convert.ToString(_UID02805BEntity.ECN_DT);

					objECNDTLM_ECN_NO.Text=_Convert.ToString(_UID02805BEntity.ECN_NO);
					objECNDTLM_SERIAL_NO.Text=_Convert.ToString(_UID02805BEntity.SERIAL_NO);
					objECNDTLM_ECN_DT.Text=_Convert.ToString(_UID02805BEntity.ECN_DT);
					objECNDTLM_ECN_ATVT_CODE.Text=_Convert.ToString(_UID02805BEntity.ECN_ATVT_CODE);
					objECNDTLM_ASSM_NO.Text=_Convert.ToString(_UID02805BEntity.ASSM_NO);
					objVARIABLE_ASSM_NAME01.Text=_Convert.ToString(_UID02805BEntity.ASSM_NAME01);
					objVARIABLE_ASSM_UOM.Text=_Convert.ToString(_UID02805BEntity.ASSM_UOM);
					objVARIABLE_ASSM_NAME02.Text=_Convert.ToString(_UID02805BEntity.ASSM_NAME02);
					objECNDTLM_ITEM_NO.Text=_Convert.ToString(_UID02805BEntity.ITEM_NO);
					objVARIABLE_ITEM_NAME01.Text=_Convert.ToString(_UID02805BEntity.ITEM_NAME01);
					objVARIABLE_UOM_CODE.Text=_Convert.ToString(_UID02805BEntity.UOM_CODE);
					objVARIABLE_ITEM_NAME02.Text=_Convert.ToString(_UID02805BEntity.ITEM_NAME02);
					objECNDTLM_ENG_QPE.Text=_Convert.ToString(_UID02805BEntity.ENG_QPE);
					objECNDTLM_UOM_ENG.Text=_Convert.ToString(_UID02805BEntity.UOM_ENG);
					objECNDTLM_UOM_XCHG.Text=_Convert.ToString(_UID02805BEntity.UOM_XCHG);
					objECNDTLM_QTY_PER.Text=_Convert.ToString(_UID02805BEntity.QTY_PER);
					objECNDTLM_SCRAP_RATE.Text=_Convert.ToString(_UID02805BEntity.SCRAP_RATE);
					objECNDTLM_WASTAGE_RATE.Text=_Convert.ToString(_UID02805BEntity.WASTAGE_RATE);
					objECNDTLM_ECN_REFX.Text=_Convert.ToString(_UID02805BEntity.ECN_REFX);
					objECNDTLM_ECN_LOCX.Text=_Convert.ToString(_UID02805BEntity.ECN_LOCX);
					objECNDTLM_ECN_RMKS.Text=_Convert.ToString(_UID02805BEntity.ECN_RMKS);

				objECNDTLM_USECURITY_CODE1.Text=_UID02805BEntity.USECURITY_CODE1;
							objECNDTLM_USECURITY_CODE2.Text=_UID02805BEntity.USECURITY_CODE2;
							objECNDTLM_USECURITY_CODE3.Text=_UID02805BEntity.USECURITY_CODE3;
							objECNDTLM_USECURITY_CODE4.Text=_UID02805BEntity.USECURITY_CODE4;
							objECNDTLM_USECURITY_CODE5.Text=_UID02805BEntity.USECURITY_CODE5;
							objECNDTLM_USECURITY_CODE6.Text=_UID02805BEntity.USECURITY_CODE6;
			
			objECNDTLM_USECURITY_RIGHT.Text = _UID02805BEntity.USECURITY_RIGHT.ToString();
			objECNDTLM_UZADD_DATE.Text      = _UID02805BEntity.UZADD_DATE;
			objECNDTLM_UZADD_USER.Text      = _UID02805BEntity.UZADD_USER;
			objECNDTLM_UZCHG_DATE.Text      = _UID02805BEntity.UZCHG_DATE;
			objECNDTLM_UZCHG_USER.Text      = _UID02805BEntity.UZCHG_USER;
		}

		public void OnInit(HttpContext  objHttpContext)		
		{

			this.UID_CODE = "UID02805B";
			this.DbName = ZZGeneral.DbName();

				_STATUS_DATA.UID_CODE="UID02805B";
			_STATUS_DATA.OnInit(objHttpContext);

			_STATUS_DATA["lnk_UID_CODE"] = "UID02805B";
			_STATUS_DATA["UID02805B","USQL_CODE"] = "QID02805B";

			this.ZZEventStatus      = _STATUS_DATA["ZZEventStatus"];
			this.ZZEventMode        = _STATUS_DATA["ZZEventMode"];
			this.ZZEventArgs        = _STATUS_DATA["ZZEventArgs"];
			this.ZZEventOpts        = _STATUS_DATA["ZZEventOpts"];
			this.ZZLOGON_SSD        = _STATUS_DATA["ZZLOGON_SSD"];
			this.ZZLOGON_LANG       = _STATUS_DATA["ZZLOGON_LANG"];
			this.ZZMODEL_DATA       = _STATUS_DATA["ZZMODEL_DATA"];

			this.ZZVIEW_STATUS_CODE = _STATUS_DATA["UID02805B","ZZVIEW_STATUS_CODE"];
			this.ZZVIEW_MODE_CODE   = _STATUS_DATA["UID02805B","ZZVIEW_MODE_CODE"];

			ZZTrace.Debug(ZFILE_NAME,"...123456...---"+this.ZZLOGON_SSD);
			ZZTrace.Debug(ZFILE_NAME,".ZZMODEL_DATA-"+this.ZZMODEL_DATA);
			ZZTrace.Debug(ZFILE_NAME,".ZZVIEW_MODE_CODE-"+this.ZZVIEW_MODE_CODE);
			ZZTrace.Debug(ZFILE_NAME,".ZZVIEW_STATUS_CODE-"+this.ZZVIEW_STATUS_CODE);

			this.Trans = new StreamContext(this.DbName);

			XLiveManagement oXLiveManagement=XLiveManagement.getInstance();
			oXLiveManagement.DbName=this.DbName;
			this.ZZLOGON_ID=oXLiveManagement[this.ZZLOGON_SSD].getValue("LOGON_ID");

			if (this.ZZLOGON_LANG=="")
			{
				this.ZZLOGON_LANG=oXLiveManagement[this.ZZLOGON_SSD].getValue("LOGON_LANG");
			}

			ZZTrace.Debug(ZFILE_NAME,"...123456...---"+this.ZZLOGON_LANG);

			_STATUS_DATA["ZZLOGON_LANG"] = this.ZZLOGON_LANG;

			_Convert.ZZLOGON_SSD = this.ZZLOGON_SSD;
			_Convert.Trans       = this.Trans;

			_Captions             = new ZZCaptions();
			_Captions.DbName      = this.DbName;
			_Captions.ZZLOGON_LANG  = this.ZZLOGON_LANG;
			_Captions.ZZLOGON_SSD = this.ZZLOGON_SSD;

			_DocsPermission.Trans = this.Trans;

			dbTab objdbTab       = new dbTab();
			objdbTab.UID_CODE    = this.UID_CODE;
			objdbTab.Trans       = this.Trans;
			objdbTab.ZZLOGON_LANG  = this.ZZLOGON_LANG;
			objdbTab.ZZLOGON_SSD = this.ZZLOGON_SSD;
			objdbTab.Create();

			objWebPanels=objdbTab.Panels;

			oWindow.AddPanels(objWebPanels);
			oWindow.Trans       = this.Trans;
			oWindow.ZZLOGON_SSD = this.ZZLOGON_SSD;
			oWindow.ZZLOGON_LANG  = this.ZZLOGON_LANG;

			Muki.Framework.ZZSetting oZZSetting = new Muki.Framework.ZZSetting();
			oZZSetting.Trans=this.Trans;

#region Quick Search

			_WebLookup.UGET_CODE   = "QDD02805B";
			_WebLookup.Trans       = this.Trans;
			_WebLookup.DbName      = this.DbName;
			_WebLookup.ZZLOGON_LANG  = this.ZZLOGON_LANG;
			_WebLookup.ZZLOGON_SSD = this.ZZLOGON_SSD;

				oWindow.AddLookUp(_WebLookup);

			XOption objXOption     = new XOption();
			objXOption.UID_CODE    = this.UID_CODE;
			objXOption.Trans       = this.Trans;

			XDepend objXDepend     = new XDepend();
			objXDepend.UID_CODE    = this.UID_CODE;
			objXDepend.Trans       = this.Trans;
			objXDepend.ZZLOGON_LANG  = this.ZZLOGON_LANG;
			objXDepend.ZZLOGON_SSD = this.ZZLOGON_SSD;

			ZZCDF _ZZCDF      = new ZZCDF();
			_ZZCDF.UID_CODE   = this.UID_CODE;
			_ZZCDF.Trans      = this.Trans;

#endregion

			oXForm             = new XForm();
			oXForm.UID_CODE    = this.UID_CODE;
			oXForm.DbName      = this.DbName;
			oXForm.ZZLOGON_LANG  = this.ZZLOGON_LANG;
			oXForm.ZZLOGON_SSD = this.ZZLOGON_SSD;
			oXForm.MODEL_DATA = this.ZZMODEL_DATA;

			//oXForm.Trans     = this.Trans;

#region XForm element

#region ECNDTLM_ECN_NO
				objECNDTLM_ECN_NO.Name              = "Txt_ECNDTLM_ECN_NO";
				objECNDTLM_ECN_NO.TABLE_COLUMN_NAME = "ECNDTLM_ECN_NO";

				objECNDTLM_ECN_NO.OnBlurEvents = "";
				objECNDTLM_ECN_NO.Length       = 12;
				objECNDTLM_ECN_NO.Height       = 0;
				objECNDTLM_ECN_NO.COLUMN_SCALE = 0;
				objECNDTLM_ECN_NO.STATUS_CODE  = "";
				objECNDTLM_ECN_NO.Compulsory   = true;
				objECNDTLM_ECN_NO.Caption      = _Captions.Caption(this.UID_CODE,"lbl_ECN_NO");
				objECNDTLM_ECN_NO.COLSPAN      = 1;
				objECNDTLM_ECN_NO.ROWSPAN      = 1;
				objECNDTLM_ECN_NO.Index        = 1010;
				objECNDTLM_ECN_NO.NEW_LINE     = true;
				objECNDTLM_ECN_NO.NEW_CELL     = true;
				objECNDTLM_ECN_NO.LINE_REVEAL  = false;

				oXForm.AddObject(objECNDTLM_ECN_NO);
				oWindow.Components.Add(objECNDTLM_ECN_NO);

#endregion //ECNDTLM_ECN_NO

#region ECNDTLM_SERIAL_NO
				objECNDTLM_SERIAL_NO.Name              = "Txt_ECNDTLM_SERIAL_NO";
				objECNDTLM_SERIAL_NO.TABLE_COLUMN_NAME = "ECNDTLM_SERIAL_NO";

				objECNDTLM_SERIAL_NO.OnBlurEvents = "";
				objECNDTLM_SERIAL_NO.Length       = 5;
				objECNDTLM_SERIAL_NO.Height       = 0;
				objECNDTLM_SERIAL_NO.COLUMN_SCALE = 0;
				objECNDTLM_SERIAL_NO.STATUS_CODE  = "";
				objECNDTLM_SERIAL_NO.Compulsory   = false;
				objECNDTLM_SERIAL_NO.Caption      = _Captions.Caption(this.UID_CODE,"lbl_SERIAL_NO");
				objECNDTLM_SERIAL_NO.COLSPAN      = 1;
				objECNDTLM_SERIAL_NO.ROWSPAN      = 1;
				objECNDTLM_SERIAL_NO.Index        = 1020;
				objECNDTLM_SERIAL_NO.NEW_LINE     = false;
				objECNDTLM_SERIAL_NO.NEW_CELL     = true;
				objECNDTLM_SERIAL_NO.LINE_REVEAL  = false;

				oXForm.AddObject(objECNDTLM_SERIAL_NO);
				oWindow.Components.Add(objECNDTLM_SERIAL_NO);

#endregion //ECNDTLM_SERIAL_NO

#region ECNDTLM_ECN_DT
				objECNDTLM_ECN_DT.Name              = "Txt_ECNDTLM_ECN_DT";
				objECNDTLM_ECN_DT.TABLE_COLUMN_NAME = "ECNDTLM_ECN_DT";

				objECNDTLM_ECN_DT.OnBlurEvents = "";
				objECNDTLM_ECN_DT.Length       = 16;
				objECNDTLM_ECN_DT.Height       = 0;
				objECNDTLM_ECN_DT.COLUMN_SCALE = 0;
				objECNDTLM_ECN_DT.STATUS_CODE  = "HIDDEN";
				objECNDTLM_ECN_DT.Compulsory   = false;
				objECNDTLM_ECN_DT.Caption      = _Captions.Caption(this.UID_CODE,"lbl_ECN_DT");
				objECNDTLM_ECN_DT.COLSPAN      = 1;
				objECNDTLM_ECN_DT.ROWSPAN      = 1;
				objECNDTLM_ECN_DT.Index        = 1030;
				objECNDTLM_ECN_DT.NEW_LINE     = true;
				objECNDTLM_ECN_DT.NEW_CELL     = true;
				objECNDTLM_ECN_DT.LINE_REVEAL  = false;

				oXForm.AddObject(objECNDTLM_ECN_DT);
				oWindow.Components.Add(objECNDTLM_ECN_DT);

#endregion //ECNDTLM_ECN_DT

#region ECNDTLM_ECN_ATVT_CODE
				objECNDTLM_ECN_ATVT_CODE.Name              = "Txt_ECNDTLM_ECN_ATVT_CODE";
				objECNDTLM_ECN_ATVT_CODE.TABLE_COLUMN_NAME = "ECNDTLM_ECN_ATVT_CODE";

				objECNDTLM_ECN_ATVT_CODE.OnBlurEvents = "";
				objECNDTLM_ECN_ATVT_CODE.Length       = 12;
				objECNDTLM_ECN_ATVT_CODE.Height       = 0;
				objECNDTLM_ECN_ATVT_CODE.COLUMN_SCALE = 0;
				objECNDTLM_ECN_ATVT_CODE.STATUS_CODE  = "ADDNEW,UPDATE";
				objECNDTLM_ECN_ATVT_CODE.Compulsory   = false;
				objECNDTLM_ECN_ATVT_CODE.Caption      = _Captions.Caption(this.UID_CODE,"lbl_ECN_ATVT_CODE");
				objECNDTLM_ECN_ATVT_CODE.COLSPAN      = 4;
				objECNDTLM_ECN_ATVT_CODE.ROWSPAN      = 1;
				objECNDTLM_ECN_ATVT_CODE.Index        = 1040;
				objECNDTLM_ECN_ATVT_CODE.NEW_LINE     = true;
				objECNDTLM_ECN_ATVT_CODE.NEW_CELL     = true;
				objECNDTLM_ECN_ATVT_CODE.LINE_REVEAL  = false;

				oXForm.AddObject(objECNDTLM_ECN_ATVT_CODE);
				oWindow.Components.Add(objECNDTLM_ECN_ATVT_CODE);

					objXOption.COLUMN_NAME="OPT_ECN_OPER";
					objXOption.Process();
					objECNDTLM_ECN_ATVT_CODE.Option         = objXOption.Option;

#endregion //ECNDTLM_ECN_ATVT_CODE

#region ECNDTLM_ASSM_NO
				objECNDTLM_ASSM_NO.Name              = "Txt_ECNDTLM_ASSM_NO";
				objECNDTLM_ASSM_NO.TABLE_COLUMN_NAME = "ECNDTLM_ASSM_NO";

				objECNDTLM_ASSM_NO.OnBlurEvents = "";
				objECNDTLM_ASSM_NO.Length       = 18;
				objECNDTLM_ASSM_NO.Height       = 0;
				objECNDTLM_ASSM_NO.COLUMN_SCALE = 0;
				objECNDTLM_ASSM_NO.STATUS_CODE  = "ADDNEW";
				objECNDTLM_ASSM_NO.Compulsory   = true;
				objECNDTLM_ASSM_NO.Caption      = _Captions.Caption(this.UID_CODE,"lbl_ASSM_NO");
				objECNDTLM_ASSM_NO.COLSPAN      = 1;
				objECNDTLM_ASSM_NO.ROWSPAN      = 1;
				objECNDTLM_ASSM_NO.Index        = 1050;
				objECNDTLM_ASSM_NO.NEW_LINE     = true;
				objECNDTLM_ASSM_NO.NEW_CELL     = true;
				objECNDTLM_ASSM_NO.LINE_REVEAL  = false;

				oXForm.AddObject(objECNDTLM_ASSM_NO);
				oWindow.Components.Add(objECNDTLM_ASSM_NO);

					objECNDTLM_ASSM_NO.Browser        = objECNDTLM_ASSM_NOBrw;
					objECNDTLM_ASSM_NOBrw.UGET_CODE   = "BXD20282A";
					objECNDTLM_ASSM_NOBrw.Data_Viewer = "";
					objECNDTLM_ASSM_NOBrw.ACTIVE_FIELD ="PARTBLM.ITEM_NO";

						objECNDTLM_ASSM_NO.OnBlurEvents="RefreshData('BXD20282A','XREF','Txt_ECNDTLM_ASSM_NO');";
					objECNDTLM_ASSM_NO.OnBlurEvents="RefreshData('BXD20282A','VIEW','Txt_ECNDTLM_ASSM_NO');";

					objECNDTLM_ASSM_NO.UGET_CODE="BXD20282A";

#endregion //ECNDTLM_ASSM_NO

#region VARIABLE_ASSM_NAME01
				objVARIABLE_ASSM_NAME01.Name              = "Txt_VARIABLE_ASSM_NAME01";
				objVARIABLE_ASSM_NAME01.TABLE_COLUMN_NAME = "VARIABLE_ASSM_NAME01";

				objVARIABLE_ASSM_NAME01.OnBlurEvents = "";
				objVARIABLE_ASSM_NAME01.Length       = 40;
				objVARIABLE_ASSM_NAME01.Height       = 0;
				objVARIABLE_ASSM_NAME01.COLUMN_SCALE = 0;
				objVARIABLE_ASSM_NAME01.STATUS_CODE  = "";
				objVARIABLE_ASSM_NAME01.Compulsory   = false;
				objVARIABLE_ASSM_NAME01.Caption      = _Captions.Caption(this.UID_CODE,"lbl_ASSM_NAME01");
				objVARIABLE_ASSM_NAME01.COLSPAN      = 4;
				objVARIABLE_ASSM_NAME01.ROWSPAN      = 1;
				objVARIABLE_ASSM_NAME01.Index        = 1060;
				objVARIABLE_ASSM_NAME01.NEW_LINE     = false;
				objVARIABLE_ASSM_NAME01.NEW_CELL     = true;
				objVARIABLE_ASSM_NAME01.LINE_REVEAL  = false;

				oXForm.AddObject(objVARIABLE_ASSM_NAME01);
				oWindow.Components.Add(objVARIABLE_ASSM_NAME01);

#endregion //VARIABLE_ASSM_NAME01

#region VARIABLE_ASSM_UOM
				objVARIABLE_ASSM_UOM.Name              = "Txt_VARIABLE_ASSM_UOM";
				objVARIABLE_ASSM_UOM.TABLE_COLUMN_NAME = "VARIABLE_ASSM_UOM";

				objVARIABLE_ASSM_UOM.OnBlurEvents = "";
				objVARIABLE_ASSM_UOM.Length       = 6;
				objVARIABLE_ASSM_UOM.Height       = 0;
				objVARIABLE_ASSM_UOM.COLUMN_SCALE = 0;
				objVARIABLE_ASSM_UOM.STATUS_CODE  = "";
				objVARIABLE_ASSM_UOM.Compulsory   = false;
				objVARIABLE_ASSM_UOM.Caption      = _Captions.Caption(this.UID_CODE,"lbl_ASSM_UOM");
				objVARIABLE_ASSM_UOM.COLSPAN      = 1;
				objVARIABLE_ASSM_UOM.ROWSPAN      = 1;
				objVARIABLE_ASSM_UOM.Index        = 1070;
				objVARIABLE_ASSM_UOM.NEW_LINE     = true;
				objVARIABLE_ASSM_UOM.NEW_CELL     = true;
				objVARIABLE_ASSM_UOM.LINE_REVEAL  = false;

				oXForm.AddObject(objVARIABLE_ASSM_UOM);
				oWindow.Components.Add(objVARIABLE_ASSM_UOM);

#endregion //VARIABLE_ASSM_UOM

#region VARIABLE_ASSM_NAME02
				objVARIABLE_ASSM_NAME02.Name              = "Txt_VARIABLE_ASSM_NAME02";
				objVARIABLE_ASSM_NAME02.TABLE_COLUMN_NAME = "VARIABLE_ASSM_NAME02";

				objVARIABLE_ASSM_NAME02.OnBlurEvents = "";
				objVARIABLE_ASSM_NAME02.Length       = 40;
				objVARIABLE_ASSM_NAME02.Height       = 0;
				objVARIABLE_ASSM_NAME02.COLUMN_SCALE = 0;
				objVARIABLE_ASSM_NAME02.STATUS_CODE  = "";
				objVARIABLE_ASSM_NAME02.Compulsory   = false;
				objVARIABLE_ASSM_NAME02.Caption      = _Captions.Caption(this.UID_CODE,"lbl_ASSM_NAME02");
				objVARIABLE_ASSM_NAME02.COLSPAN      = 4;
				objVARIABLE_ASSM_NAME02.ROWSPAN      = 1;
				objVARIABLE_ASSM_NAME02.Index        = 1080;
				objVARIABLE_ASSM_NAME02.NEW_LINE     = false;
				objVARIABLE_ASSM_NAME02.NEW_CELL     = true;
				objVARIABLE_ASSM_NAME02.LINE_REVEAL  = false;

				oXForm.AddObject(objVARIABLE_ASSM_NAME02);
				oWindow.Components.Add(objVARIABLE_ASSM_NAME02);

#endregion //VARIABLE_ASSM_NAME02

#region ECNDTLM_ITEM_NO
				objECNDTLM_ITEM_NO.Name              = "Txt_ECNDTLM_ITEM_NO";
				objECNDTLM_ITEM_NO.TABLE_COLUMN_NAME = "ECNDTLM_ITEM_NO";

				objECNDTLM_ITEM_NO.OnBlurEvents = "";
				objECNDTLM_ITEM_NO.Length       = 18;
				objECNDTLM_ITEM_NO.Height       = 0;
				objECNDTLM_ITEM_NO.COLUMN_SCALE = 0;
				objECNDTLM_ITEM_NO.STATUS_CODE  = "ADDNEW";
				objECNDTLM_ITEM_NO.Compulsory   = true;
				objECNDTLM_ITEM_NO.Caption      = _Captions.Caption(this.UID_CODE,"lbl_ITEM_NO");
				objECNDTLM_ITEM_NO.COLSPAN      = 1;
				objECNDTLM_ITEM_NO.ROWSPAN      = 1;
				objECNDTLM_ITEM_NO.Index        = 1090;
				objECNDTLM_ITEM_NO.NEW_LINE     = true;
				objECNDTLM_ITEM_NO.NEW_CELL     = true;
				objECNDTLM_ITEM_NO.LINE_REVEAL  = true;

				oXForm.AddObject(objECNDTLM_ITEM_NO);
				oWindow.Components.Add(objECNDTLM_ITEM_NO);

					objECNDTLM_ITEM_NO.Browser        = objECNDTLM_ITEM_NOBrw;
					objECNDTLM_ITEM_NOBrw.UGET_CODE   = "UGET0007A";
					objECNDTLM_ITEM_NOBrw.Data_Viewer = "";
					objECNDTLM_ITEM_NOBrw.ACTIVE_FIELD ="PARTBLM.ITEM_NO";

						objECNDTLM_ITEM_NO.OnBlurEvents="RefreshData('UGET0007A','XREF','Txt_ECNDTLM_ITEM_NO');";
					objECNDTLM_ITEM_NO.OnBlurEvents="RefreshData('BXD20283A','VIEW','Txt_ECNDTLM_ITEM_NO');";

					objECNDTLM_ITEM_NO.UGET_CODE="UGET0007A";

#endregion //ECNDTLM_ITEM_NO

#region VARIABLE_ITEM_NAME01
				objVARIABLE_ITEM_NAME01.Name              = "Txt_VARIABLE_ITEM_NAME01";
				objVARIABLE_ITEM_NAME01.TABLE_COLUMN_NAME = "VARIABLE_ITEM_NAME01";

				objVARIABLE_ITEM_NAME01.OnBlurEvents = "";
				objVARIABLE_ITEM_NAME01.Length       = 40;
				objVARIABLE_ITEM_NAME01.Height       = 0;
				objVARIABLE_ITEM_NAME01.COLUMN_SCALE = 0;
				objVARIABLE_ITEM_NAME01.STATUS_CODE  = "";
				objVARIABLE_ITEM_NAME01.Compulsory   = false;
				objVARIABLE_ITEM_NAME01.Caption      = _Captions.Caption(this.UID_CODE,"lbl_ITEM_NAME01");
				objVARIABLE_ITEM_NAME01.COLSPAN      = 4;
				objVARIABLE_ITEM_NAME01.ROWSPAN      = 1;
				objVARIABLE_ITEM_NAME01.Index        = 1100;
				objVARIABLE_ITEM_NAME01.NEW_LINE     = false;
				objVARIABLE_ITEM_NAME01.NEW_CELL     = true;
				objVARIABLE_ITEM_NAME01.LINE_REVEAL  = false;

				oXForm.AddObject(objVARIABLE_ITEM_NAME01);
				oWindow.Components.Add(objVARIABLE_ITEM_NAME01);

#endregion //VARIABLE_ITEM_NAME01

#region VARIABLE_UOM_CODE
				objVARIABLE_UOM_CODE.Name              = "Txt_VARIABLE_UOM_CODE";
				objVARIABLE_UOM_CODE.TABLE_COLUMN_NAME = "VARIABLE_UOM_CODE";

				objVARIABLE_UOM_CODE.OnBlurEvents = "";
				objVARIABLE_UOM_CODE.Length       = 6;
				objVARIABLE_UOM_CODE.Height       = 0;
				objVARIABLE_UOM_CODE.COLUMN_SCALE = 0;
				objVARIABLE_UOM_CODE.STATUS_CODE  = "";
				objVARIABLE_UOM_CODE.Compulsory   = false;
				objVARIABLE_UOM_CODE.Caption      = _Captions.Caption(this.UID_CODE,"lbl_UOM_CODE");
				objVARIABLE_UOM_CODE.COLSPAN      = 1;
				objVARIABLE_UOM_CODE.ROWSPAN      = 1;
				objVARIABLE_UOM_CODE.Index        = 1110;
				objVARIABLE_UOM_CODE.NEW_LINE     = true;
				objVARIABLE_UOM_CODE.NEW_CELL     = true;
				objVARIABLE_UOM_CODE.LINE_REVEAL  = false;

				oXForm.AddObject(objVARIABLE_UOM_CODE);
				oWindow.Components.Add(objVARIABLE_UOM_CODE);

#endregion //VARIABLE_UOM_CODE

#region VARIABLE_ITEM_NAME02
				objVARIABLE_ITEM_NAME02.Name              = "Txt_VARIABLE_ITEM_NAME02";
				objVARIABLE_ITEM_NAME02.TABLE_COLUMN_NAME = "VARIABLE_ITEM_NAME02";

				objVARIABLE_ITEM_NAME02.OnBlurEvents = "";
				objVARIABLE_ITEM_NAME02.Length       = 40;
				objVARIABLE_ITEM_NAME02.Height       = 0;
				objVARIABLE_ITEM_NAME02.COLUMN_SCALE = 0;
				objVARIABLE_ITEM_NAME02.STATUS_CODE  = "";
				objVARIABLE_ITEM_NAME02.Compulsory   = false;
				objVARIABLE_ITEM_NAME02.Caption      = _Captions.Caption(this.UID_CODE,"lbl_ITEM_NAME02");
				objVARIABLE_ITEM_NAME02.COLSPAN      = 4;
				objVARIABLE_ITEM_NAME02.ROWSPAN      = 1;
				objVARIABLE_ITEM_NAME02.Index        = 1120;
				objVARIABLE_ITEM_NAME02.NEW_LINE     = false;
				objVARIABLE_ITEM_NAME02.NEW_CELL     = true;
				objVARIABLE_ITEM_NAME02.LINE_REVEAL  = false;

				oXForm.AddObject(objVARIABLE_ITEM_NAME02);
				oWindow.Components.Add(objVARIABLE_ITEM_NAME02);

#endregion //VARIABLE_ITEM_NAME02

#region ECNDTLM_ENG_QPE
				objECNDTLM_ENG_QPE.Name              = "Txt_ECNDTLM_ENG_QPE";
				objECNDTLM_ENG_QPE.TABLE_COLUMN_NAME = "ECNDTLM_ENG_QPE";

				objECNDTLM_ENG_QPE.OnBlurEvents = "";
				objECNDTLM_ENG_QPE.Length       = 18;
				objECNDTLM_ENG_QPE.Height       = 0;
				objECNDTLM_ENG_QPE.COLUMN_SCALE = 7;
				objECNDTLM_ENG_QPE.STATUS_CODE  = "ADDNEW,UPDATE";
				objECNDTLM_ENG_QPE.Compulsory   = true;
				objECNDTLM_ENG_QPE.Caption      = _Captions.Caption(this.UID_CODE,"lbl_ENG_QPE");
				objECNDTLM_ENG_QPE.COLSPAN      = 1;
				objECNDTLM_ENG_QPE.ROWSPAN      = 1;
				objECNDTLM_ENG_QPE.Index        = 1130;
				objECNDTLM_ENG_QPE.NEW_LINE     = true;
				objECNDTLM_ENG_QPE.NEW_CELL     = true;
				objECNDTLM_ENG_QPE.LINE_REVEAL  = false;

				oXForm.AddObject(objECNDTLM_ENG_QPE);
				oWindow.Components.Add(objECNDTLM_ENG_QPE);

#endregion //ECNDTLM_ENG_QPE

#region ECNDTLM_UOM_ENG
				objECNDTLM_UOM_ENG.Name              = "Txt_ECNDTLM_UOM_ENG";
				objECNDTLM_UOM_ENG.TABLE_COLUMN_NAME = "ECNDTLM_UOM_ENG";

				objECNDTLM_UOM_ENG.OnBlurEvents = "";
				objECNDTLM_UOM_ENG.Length       = 6;
				objECNDTLM_UOM_ENG.Height       = 0;
				objECNDTLM_UOM_ENG.COLUMN_SCALE = 0;
				objECNDTLM_UOM_ENG.STATUS_CODE  = "";
				objECNDTLM_UOM_ENG.Compulsory   = true;
				objECNDTLM_UOM_ENG.Caption      = _Captions.Caption(this.UID_CODE,"lbl_UOM_ENG");
				objECNDTLM_UOM_ENG.COLSPAN      = 1;
				objECNDTLM_UOM_ENG.ROWSPAN      = 1;
				objECNDTLM_UOM_ENG.Index        = 1140;
				objECNDTLM_UOM_ENG.NEW_LINE     = false;
				objECNDTLM_UOM_ENG.NEW_CELL     = true;
				objECNDTLM_UOM_ENG.LINE_REVEAL  = false;

				oXForm.AddObject(objECNDTLM_UOM_ENG);
				oWindow.Components.Add(objECNDTLM_UOM_ENG);

					objECNDTLM_UOM_ENG.Browser        = objECNDTLM_UOM_ENGBrw;
					objECNDTLM_UOM_ENGBrw.UGET_CODE   = "UOM_CODE";
					objECNDTLM_UOM_ENGBrw.Data_Viewer = "";
					objECNDTLM_UOM_ENGBrw.ACTIVE_FIELD ="UOMTBLM.UOM_CODE";

					objECNDTLM_UOM_ENG.OnBlurEvents="RefreshData('UOM_CODE','XREF','Txt_ECNDTLM_UOM_ENG');";

					objECNDTLM_UOM_ENG.UGET_CODE="UOM_CODE";

#endregion //ECNDTLM_UOM_ENG

#region ECNDTLM_UOM_XCHG
				objECNDTLM_UOM_XCHG.Name              = "Txt_ECNDTLM_UOM_XCHG";
				objECNDTLM_UOM_XCHG.TABLE_COLUMN_NAME = "ECNDTLM_UOM_XCHG";

				objECNDTLM_UOM_XCHG.OnBlurEvents = "";
				objECNDTLM_UOM_XCHG.Length       = 15;
				objECNDTLM_UOM_XCHG.Height       = 0;
				objECNDTLM_UOM_XCHG.COLUMN_SCALE = 7;
				objECNDTLM_UOM_XCHG.STATUS_CODE  = "";
				objECNDTLM_UOM_XCHG.Compulsory   = false;
				objECNDTLM_UOM_XCHG.Caption      = _Captions.Caption(this.UID_CODE,"lbl_UOM_XCHG");
				objECNDTLM_UOM_XCHG.COLSPAN      = 1;
				objECNDTLM_UOM_XCHG.ROWSPAN      = 1;
				objECNDTLM_UOM_XCHG.Index        = 1150;
				objECNDTLM_UOM_XCHG.NEW_LINE     = false;
				objECNDTLM_UOM_XCHG.NEW_CELL     = true;
				objECNDTLM_UOM_XCHG.LINE_REVEAL  = false;

				oXForm.AddObject(objECNDTLM_UOM_XCHG);
				oWindow.Components.Add(objECNDTLM_UOM_XCHG);

#endregion //ECNDTLM_UOM_XCHG

#region ECNDTLM_QTY_PER
				objECNDTLM_QTY_PER.Name              = "Txt_ECNDTLM_QTY_PER";
				objECNDTLM_QTY_PER.TABLE_COLUMN_NAME = "ECNDTLM_QTY_PER";

				objECNDTLM_QTY_PER.OnBlurEvents = "";
				objECNDTLM_QTY_PER.Length       = 18;
				objECNDTLM_QTY_PER.Height       = 0;
				objECNDTLM_QTY_PER.COLUMN_SCALE = 7;
				objECNDTLM_QTY_PER.STATUS_CODE  = "";
				objECNDTLM_QTY_PER.Compulsory   = false;
				objECNDTLM_QTY_PER.Caption      = _Captions.Caption(this.UID_CODE,"lbl_QTY_PER");
				objECNDTLM_QTY_PER.COLSPAN      = 1;
				objECNDTLM_QTY_PER.ROWSPAN      = 1;
				objECNDTLM_QTY_PER.Index        = 1160;
				objECNDTLM_QTY_PER.NEW_LINE     = true;
				objECNDTLM_QTY_PER.NEW_CELL     = true;
				objECNDTLM_QTY_PER.LINE_REVEAL  = false;

				oXForm.AddObject(objECNDTLM_QTY_PER);
				oWindow.Components.Add(objECNDTLM_QTY_PER);

#endregion //ECNDTLM_QTY_PER

#region ECNDTLM_SCRAP_RATE
				objECNDTLM_SCRAP_RATE.Name              = "Txt_ECNDTLM_SCRAP_RATE";
				objECNDTLM_SCRAP_RATE.TABLE_COLUMN_NAME = "ECNDTLM_SCRAP_RATE";

				objECNDTLM_SCRAP_RATE.OnBlurEvents = "";
				objECNDTLM_SCRAP_RATE.Length       = 20;
				objECNDTLM_SCRAP_RATE.Height       = 0;
				objECNDTLM_SCRAP_RATE.COLUMN_SCALE = 8;
				objECNDTLM_SCRAP_RATE.STATUS_CODE  = "ADDNEW,UPDATE";
				objECNDTLM_SCRAP_RATE.Compulsory   = false;
				objECNDTLM_SCRAP_RATE.Caption      = _Captions.Caption(this.UID_CODE,"lbl_SCRAP_RATE");
				objECNDTLM_SCRAP_RATE.COLSPAN      = 1;
				objECNDTLM_SCRAP_RATE.ROWSPAN      = 1;
				objECNDTLM_SCRAP_RATE.Index        = 1170;
				objECNDTLM_SCRAP_RATE.NEW_LINE     = false;
				objECNDTLM_SCRAP_RATE.NEW_CELL     = true;
				objECNDTLM_SCRAP_RATE.LINE_REVEAL  = false;

				oXForm.AddObject(objECNDTLM_SCRAP_RATE);
				oWindow.Components.Add(objECNDTLM_SCRAP_RATE);

#endregion //ECNDTLM_SCRAP_RATE

#region ECNDTLM_WASTAGE_RATE
				objECNDTLM_WASTAGE_RATE.Name              = "Txt_ECNDTLM_WASTAGE_RATE";
				objECNDTLM_WASTAGE_RATE.TABLE_COLUMN_NAME = "ECNDTLM_WASTAGE_RATE";

				objECNDTLM_WASTAGE_RATE.OnBlurEvents = "";
				objECNDTLM_WASTAGE_RATE.Length       = 20;
				objECNDTLM_WASTAGE_RATE.Height       = 0;
				objECNDTLM_WASTAGE_RATE.COLUMN_SCALE = 8;
				objECNDTLM_WASTAGE_RATE.STATUS_CODE  = "ADDNEW,UPDATE";
				objECNDTLM_WASTAGE_RATE.Compulsory   = false;
				objECNDTLM_WASTAGE_RATE.Caption      = _Captions.Caption(this.UID_CODE,"lbl_WASTAGE_RATE");
				objECNDTLM_WASTAGE_RATE.COLSPAN      = 1;
				objECNDTLM_WASTAGE_RATE.ROWSPAN      = 1;
				objECNDTLM_WASTAGE_RATE.Index        = 1180;
				objECNDTLM_WASTAGE_RATE.NEW_LINE     = false;
				objECNDTLM_WASTAGE_RATE.NEW_CELL     = true;
				objECNDTLM_WASTAGE_RATE.LINE_REVEAL  = false;

				oXForm.AddObject(objECNDTLM_WASTAGE_RATE);
				oWindow.Components.Add(objECNDTLM_WASTAGE_RATE);

#endregion //ECNDTLM_WASTAGE_RATE

#region ECNDTLM_ECN_REFX
				objECNDTLM_ECN_REFX.Name              = "Txt_ECNDTLM_ECN_REFX";
				objECNDTLM_ECN_REFX.TABLE_COLUMN_NAME = "ECNDTLM_ECN_REFX";

				objECNDTLM_ECN_REFX.OnBlurEvents = "";
				objECNDTLM_ECN_REFX.Length       = 15;
				objECNDTLM_ECN_REFX.Height       = 0;
				objECNDTLM_ECN_REFX.COLUMN_SCALE = 0;
				objECNDTLM_ECN_REFX.STATUS_CODE  = "ADDNEW,UPDATE";
				objECNDTLM_ECN_REFX.Compulsory   = false;
				objECNDTLM_ECN_REFX.Caption      = _Captions.Caption(this.UID_CODE,"lbl_ECN_REFX");
				objECNDTLM_ECN_REFX.COLSPAN      = 1;
				objECNDTLM_ECN_REFX.ROWSPAN      = 1;
				objECNDTLM_ECN_REFX.Index        = 1190;
				objECNDTLM_ECN_REFX.NEW_LINE     = true;
				objECNDTLM_ECN_REFX.NEW_CELL     = true;
				objECNDTLM_ECN_REFX.LINE_REVEAL  = false;

				oXForm.AddObject(objECNDTLM_ECN_REFX);
				oWindow.Components.Add(objECNDTLM_ECN_REFX);

#endregion //ECNDTLM_ECN_REFX

#region ECNDTLM_ECN_LOCX
				objECNDTLM_ECN_LOCX.Name              = "Txt_ECNDTLM_ECN_LOCX";
				objECNDTLM_ECN_LOCX.TABLE_COLUMN_NAME = "ECNDTLM_ECN_LOCX";

				objECNDTLM_ECN_LOCX.OnBlurEvents = "";
				objECNDTLM_ECN_LOCX.Length       = 30;
				objECNDTLM_ECN_LOCX.Height       = 0;
				objECNDTLM_ECN_LOCX.COLUMN_SCALE = 0;
				objECNDTLM_ECN_LOCX.STATUS_CODE  = "ADDNEW,UPDATE";
				objECNDTLM_ECN_LOCX.Compulsory   = false;
				objECNDTLM_ECN_LOCX.Caption      = _Captions.Caption(this.UID_CODE,"lbl_ECN_LOCX");
				objECNDTLM_ECN_LOCX.COLSPAN      = 4;
				objECNDTLM_ECN_LOCX.ROWSPAN      = 1;
				objECNDTLM_ECN_LOCX.Index        = 1200;
				objECNDTLM_ECN_LOCX.NEW_LINE     = false;
				objECNDTLM_ECN_LOCX.NEW_CELL     = true;
				objECNDTLM_ECN_LOCX.LINE_REVEAL  = false;

				oXForm.AddObject(objECNDTLM_ECN_LOCX);
				oWindow.Components.Add(objECNDTLM_ECN_LOCX);

#endregion //ECNDTLM_ECN_LOCX

#region ECNDTLM_ECN_RMKS
				objECNDTLM_ECN_RMKS.Name              = "Txt_ECNDTLM_ECN_RMKS";
				objECNDTLM_ECN_RMKS.TABLE_COLUMN_NAME = "ECNDTLM_ECN_RMKS";

				objECNDTLM_ECN_RMKS.OnBlurEvents = "";
				objECNDTLM_ECN_RMKS.Length       = 80;
				objECNDTLM_ECN_RMKS.Height       = 0;
				objECNDTLM_ECN_RMKS.COLUMN_SCALE = 0;
				objECNDTLM_ECN_RMKS.STATUS_CODE  = "ADDNEW,UPDATE";
				objECNDTLM_ECN_RMKS.Compulsory   = false;
				objECNDTLM_ECN_RMKS.Caption      = _Captions.Caption(this.UID_CODE,"lbl_ECN_RMKS");
				objECNDTLM_ECN_RMKS.COLSPAN      = 4;
				objECNDTLM_ECN_RMKS.ROWSPAN      = 1;
				objECNDTLM_ECN_RMKS.Index        = 1210;
				objECNDTLM_ECN_RMKS.NEW_LINE     = true;
				objECNDTLM_ECN_RMKS.NEW_CELL     = true;
				objECNDTLM_ECN_RMKS.LINE_REVEAL  = false;

				oXForm.AddObject(objECNDTLM_ECN_RMKS);
				oWindow.Components.Add(objECNDTLM_ECN_RMKS);

#endregion //ECNDTLM_ECN_RMKS

			_ZZCDF.Process();

			foreach (VContexts oVContexts in _ZZCDF.ZZCDFS) 
			{
				AComponent oCDFElement;

				if (oVContexts.getValue("CDF_TP_CODE")=="D")
				{
					oCDFElement=new WebDateBox();
				}else if (oVContexts.getValue("CDF_CODE")=="L")
				{
					oCDFElement=new WebCheckBox();
				}else if (oVContexts.getValue("CDF_CODE")=="N")
				{
					oCDFElement=new WebFloatBox();
				}else{
					oCDFElement=new WebTextBox();
				}

				oCDFElement.Name          = "Txt_CDF_"+oVContexts.getValue("CDF_CODE");
				oCDFElement.Length        = oVContexts.getInteger("CDF_LENGTH");
				oCDFElement.Height        = 1;
				oCDFElement.COLUMN_SCALE = oVContexts.getInteger("COLUMN_SCALE");
				oCDFElement.STATUS_CODE   = oVContexts.getValue("STATUS_CODE");
				oCDFElement.Compulsory    = !oVContexts.getBoolean("COLUMN_NULLABLE");

				if (oVContexts.getValue("LABEL_ID")!="")
				{
					oCDFElement.Caption     =_Captions.Caption(this.UID_CODE,oVContexts.getValue("LABEL_ID"));
				}else{
					oCDFElement.Caption     =oVContexts.getValue("CDF_NAME01");
				}
				oCDFElement.COLSPAN      = 1;
				oCDFElement.ROWSPAN      = 1;
				oCDFElement.Index        = oVContexts.getInteger("ORDINAL");
				oCDFElement.NEW_LINE     = true;
				oCDFElement.NEW_CELL     = true;
				oCDFElement.LINE_REVEAL  = false;

				_ZZCDFElect.Add(oCDFElement);
				oXForm.AddObject(oCDFElement);
				oWindow.Components.Add(oCDFElement);

			}

#endregion

				if (_DocsPermission.AccessRight(this.UID_CODE,this.ZZLOGON_ID,"SECURITY_CODE")==true)
				{
#region SECURITY_CODE

							objECNDTLM_USECURITY_CODE1.NEW_LINE    =true;
						objECNDTLM_USECURITY_CODE1.Name    = "Txt_ECNDTLM_USECURITY_CODE1";
						objECNDTLM_USECURITY_CODE1.Caption = _Captions.Caption(this.UID_CODE,"lbl_USECURITY_CODE1");
						oXForm.AuthObject(objECNDTLM_USECURITY_CODE1);

											objECNDTLM_USECURITY_CODE2.Name    = "Txt_ECNDTLM_USECURITY_CODE2";
						objECNDTLM_USECURITY_CODE2.Caption = _Captions.Caption(this.UID_CODE,"lbl_USECURITY_CODE2");
						oXForm.AuthObject(objECNDTLM_USECURITY_CODE2);

												objECNDTLM_USECURITY_CODE3.NEW_LINE    =true;
						objECNDTLM_USECURITY_CODE3.Name    = "Txt_ECNDTLM_USECURITY_CODE3";
						objECNDTLM_USECURITY_CODE3.Caption = _Captions.Caption(this.UID_CODE,"lbl_USECURITY_CODE3");
						oXForm.AuthObject(objECNDTLM_USECURITY_CODE3);

											objECNDTLM_USECURITY_CODE4.Name    = "Txt_ECNDTLM_USECURITY_CODE4";
						objECNDTLM_USECURITY_CODE4.Caption = _Captions.Caption(this.UID_CODE,"lbl_USECURITY_CODE4");
						oXForm.AuthObject(objECNDTLM_USECURITY_CODE4);

												objECNDTLM_USECURITY_CODE5.NEW_LINE    =true;
						objECNDTLM_USECURITY_CODE5.Name    = "Txt_ECNDTLM_USECURITY_CODE5";
						objECNDTLM_USECURITY_CODE5.Caption = _Captions.Caption(this.UID_CODE,"lbl_USECURITY_CODE5");
						oXForm.AuthObject(objECNDTLM_USECURITY_CODE5);

											objECNDTLM_USECURITY_CODE6.Name    = "Txt_ECNDTLM_USECURITY_CODE6";
						objECNDTLM_USECURITY_CODE6.Caption = _Captions.Caption(this.UID_CODE,"lbl_USECURITY_CODE6");
						oXForm.AuthObject(objECNDTLM_USECURITY_CODE6);

					#region USECURITY_RIGHT

					objECNDTLM_USECURITY_RIGHT.NEW_LINE = true;
					objECNDTLM_USECURITY_RIGHT.Name     = "Txt_ECNDTLM_USECURITY_RIGHT";
					objECNDTLM_USECURITY_RIGHT.Caption  = _Captions.Caption(this.UID_CODE,"lbl_USECURITY_RIGHT");
					oXForm.AuthObject(objECNDTLM_USECURITY_RIGHT);

#endregion

#region USTAGE_CODE

					objECNDTLM_USTAGE_CODE.NEW_LINE = false;
					objECNDTLM_USTAGE_CODE.Name     = "Txt_ECNDTLM_USTAGE_CODE";
					objECNDTLM_USTAGE_CODE.Caption  = _Captions.Caption(this.UID_CODE,"lbl_USTAGE_CODE");
					oXForm.AuthObject(objECNDTLM_USTAGE_CODE);

#endregion

#region ZADD_DATE

					objECNDTLM_UZADD_DATE.NEW_LINE = true;
					objECNDTLM_UZADD_DATE.Name     = "Txt_ECNDTLM_UZADD_DATE";
					objECNDTLM_UZADD_DATE.Caption  = _Captions.Caption(this.UID_CODE,"lbl_UZADD_DATE");
					oXForm.AuthObject(objECNDTLM_UZADD_DATE);

#endregion

#region ZADD_USER

					objECNDTLM_UZADD_USER.Name    = "Txt_ECNDTLM_UZADD_USER";
					objECNDTLM_UZADD_USER.Caption = _Captions.Caption(this.UID_CODE,"lbl_UZADD_USER");
					oXForm.AuthObject(objECNDTLM_UZADD_USER);

#endregion

#region ZCHG_DATE
					objECNDTLM_UZCHG_DATE.NEW_LINE = true;
					objECNDTLM_UZCHG_DATE.Name     = "Txt_ECNDTLM_UZCHG_DATE";
					objECNDTLM_UZCHG_DATE.Caption  = _Captions.Caption(this.UID_CODE,"lbl_UZCHG_DATE");
					oXForm.AuthObject(objECNDTLM_UZCHG_DATE);

#endregion

#region ZCHG_USER
					objECNDTLM_UZCHG_USER.Name    = "Txt_ECNDTLM_UZCHG_USER";
					objECNDTLM_UZCHG_USER.Caption = _Captions.Caption(this.UID_CODE,"lbl_UZCHG_USER");
					oXForm.AuthObject(objECNDTLM_UZCHG_USER);
#endregion
				}

#endregion

#region UXDIR_CODE
			objDATA_VFS_UXDIR_CODE.Name        = "Txt_DATA_VFS_UXDIR_CODE";
			objDATA_VFS_UXDIR_CODE.Caption     = _Captions.Caption(this.UID_CODE,"lbl_UXDIR_CODE");
			objDATA_VFS_UXDIR_CODE.NEW_CELL    = true;
			objDATA_VFS_UXDIR_CODE.NEW_LINE    = true;
			objDATA_VFS_UXDIR_CODE.Index       = 102002;
			objDATA_VFS_UXDIR_CODE.STATUS_CODE = "HIDDEN";

			oXForm.AddObject(objDATA_VFS_UXDIR_CODE);
			oWindow.Components.Add(objDATA_VFS_UXDIR_CODE);

#endregion

#region XUID_CODE
			objECNDTLM_XUID_CODE.NEW_LINE = true;
			objECNDTLM_XUID_CODE.Name     = "Txt_ECNDTLM_XUID_CODE";
			objECNDTLM_XUID_CODE.Caption  = _Captions.Caption(this.UID_CODE,"lbl_XUID_CODE");
			objECNDTLM_XUID_CODE.Text     = "UID02805B";
			oXForm.AuthObject(objECNDTLM_XUID_CODE);
#endregion

			_Captions.Caption(this.UID_CODE,"lbl_XUID_CODE");

			objXDepend.Process();

			oXForm.AddXDepend(objXDepend.Depends);

			oWindow.AddWebForm(oXForm);

			//if (this.ZZEventStatus=="ADDNEW")
			//{
			//}else if (this.ZZEventStatus=="UPDATE")
			//{
			//}

			//_WebCells.ZZMUKI_EDITION = MUKI_EDITION;
			_WebCells.Name= "QID02805B";
			_WebCells.UID_CODE    = this.UID_CODE;
			_WebCells.USQL_CODE   = "QID02805B";
			_WebCells.STATUS_CODE = "VIEW";
			_WebCells.DbName    = this.DbName;
			_WebCells.PageSize    = 15;
			_WebCells.ZZLOGON_LANG  = this.ZZLOGON_LANG;
			_WebCells.ZZLOGON_SSD = this.ZZLOGON_SSD;
			_WebCells.OnInit(objHttpContext);

				if (_WebCells.USQL_CODE!="")
				{
					oWindow.AddWxfPanel(_WebCells);
				}

				oWindow.DbName = this.DbName;
			oWindow.OnInit(objHttpContext);
		}

		public void Render(HtmlTextWriter objTextWriter)
		{

#region Toolbar

			dbToolbar objdbToolbar   = new dbToolbar();
			objdbToolbar.BTNS_CODE   = "BASIC;";
			objdbToolbar.UID_CODE    = this.UID_CODE;
			objdbToolbar.Trans       = this.Trans;
			objdbToolbar.DATA_STATUS_CODE = _UID02805BEntity.DATA_STATUS_CODE;
			objdbToolbar.ZZLOGON_LANG  = this.ZZLOGON_LANG;
			objdbToolbar.ZZLOGON_SSD   = this.ZZLOGON_SSD;
			objdbToolbar.VIEW_MODE_CODE = this.ZZVIEW_MODE_CODE;

			ZZBTNS oZZBTNS         = new ZZBTNS();
			oZZBTNS.BTNS_CODE      = "UID02805B;Basic_VFS;BASIC_Actions";
			oZZBTNS.UID_CODE       = this.UID_CODE;
			oZZBTNS.BTN_CLASS_CODE = "FUNS";
			oZZBTNS.Trans          = this.Trans;
			oZZBTNS.ODTP_STATUS_CODE = objdbToolbar.ODTP_STATUS_CODE;
			oZZBTNS.DATA_STATUS_CODE = _UID02805BEntity.DATA_STATUS_CODE;
			oZZBTNS.ZZLOGON_LANG   = this.ZZLOGON_LANG;
			oZZBTNS.ZZLOGON_SSD    = this.ZZLOGON_SSD;
			oZZBTNS.VIEW_MODE_CODE = this.ZZVIEW_MODE_CODE;
			oZZBTNS.Process();

			ZZTrace.Debug(ZFILE_NAME,"oZZBTNS.BTNS.Count=["+oZZBTNS.BTNS.Count+"]");

			objdbToolbar.ActionsBTNS=oZZBTNS.BTNS;

			ZZBTNS oPRINTS           = new ZZBTNS();
			oPRINTS.BTNS_CODE        = "UID02805B;BASIC_Print";
			oPRINTS.UID_CODE         = this.UID_CODE;
			oPRINTS.BTN_CLASS_CODE   = "PRINT";
			oPRINTS.VIEW_MODE_CODE = this.ZZVIEW_MODE_CODE;
			oPRINTS.Trans            = this.Trans;
			oPRINTS.ODTP_STATUS_CODE = objdbToolbar.ODTP_STATUS_CODE;
			oPRINTS.DATA_STATUS_CODE = _UID02805BEntity.DATA_STATUS_CODE;
			oPRINTS.ZZLOGON_LANG  = this.ZZLOGON_LANG;
			oPRINTS.ZZLOGON_SSD = this.ZZLOGON_SSD;
			oPRINTS.Process();

			objdbToolbar.PrintBTNS=oPRINTS.BTNS;

			objdbToolbar.Process();

			objWebBTNS= objdbToolbar.XWebBTNS;
			oWindow.AddToolBar(objWebBTNS);
			oWindow.BTNS = objdbToolbar.BTNS;
#endregion

			objECNDTLM_USTAGE_CODE.Text=this.ZZVIEW_MODE_CODE;

			_STATUS_DATA["UID02805B","ZZVIEW_MODE_CODE"]   = this.ZZVIEW_MODE_CODE;
			_STATUS_DATA["UID02805B","ZZVIEW_STATUS_CODE"] = this.ZZVIEW_STATUS_CODE;

			oWindow.VIEW_STATUS_CODE  = this.ZZVIEW_STATUS_CODE;
			oWindow.VIEW_MODE_CODE  = this.ZZVIEW_MODE_CODE;

			_WebCells.ZZLOGON_LANG  = this.ZZLOGON_LANG;
			_WebCells.STATUS_CODE   = "VIEW";
			_WebCells.WXFLite       = this.Entity.Wxf;
			_WebCells.OperationMode = "EDIT";
			_WebCells.ZZLOGON_ID    = this.ZZLOGON_ID;
			_WebCells.Trans         = this.Trans;
			_WebCells.Process();

			oWindow.WindowsStatus = _STATUS_DATA;
			oWindow.UID_CODE      = "UID02805B";
			oWindow.Template      = "";
			oWindow.APP_PATH      = this.APP_PATH;
			ZZTrace.Debug(ZFILE_NAME,this.APP_PATH+"System\\templates\\");

			if (File.Exists(this.APP_PATH+"System\\templates\\"))
			{
				oWindow.Tmpl         = TmplManager.FromString(ZZGeneral.ReadStream(this.APP_PATH+"System\\templates\\").ToString());
			}else	if (File.Exists(this.APP_PATH+"System\\templates\\UID02805B.tpl"))
			{
				oWindow.Tmpl         = TmplManager.FromString(ZZGeneral.ReadStream(this.APP_PATH+"System\\templates\\UID02805B.tpl").ToString());
			}
			oWindow.Trans         = this.Trans;
			oWindow.Exceptions    = this.Exceptions;
			
			objXDeclareBlock.ZZLOGON_SSD=this.ZZLOGON_SSD;
			objXDeclareBlock.DbName=this.DbName;
			objXDeclareBlock.ZZLOGON_LANG  =this.ZZLOGON_LANG;
			objXDeclareBlock.Trans =this.Trans;
			objXDeclareBlock.Render(objTextWriter);

			oWindow.Render(objTextWriter);

			objTextWriter.WriteLine("<script type='text/javascript'>");
			objTextWriter.WriteLine("");

			objTextWriter.WriteLine("$(document).ready(function ()");
			objTextWriter.WriteLine("{");
			objTextWriter.WriteLine("var vModels = avalon.define(\"Fields\", function(vm) {");

			objTextWriter.WriteLine("vm.Variable={");
			objTextWriter.WriteLine("VIEW_STATUS_CODE=\'"+this.ZZVIEW_STATUS_CODE+"\',");
			objTextWriter.WriteLine("VIEW_MODE_CODE=\'"+this.ZZVIEW_MODE_CODE+"\',");
			objTextWriter.WriteLine("ZZLOGON_LANG=\'"+this.ZZLOGON_LANG+"\',");
			objTextWriter.WriteLine("ZZMODEL_DATA=\'"+this.ZZMODEL_DATA+"\'");
			objTextWriter.WriteLine("}");

			objTextWriter.WriteLine("vm.Models={");
			foreach (AComponent oElement in oXForm.Objects)
			{
				if  (oElement.TABLE_COLUMN_NAME!=""){
					objTextWriter.WriteLine(oElement.TABLE_COLUMN_NAME+":{");
					objTextWriter.WriteLine("Text:\""+Dot.StreamObject.Util.EscapeString(oElement.Text)+"\",");
					objTextWriter.WriteLine("Class:\""+oElement.ClassName+"\",");
					if (oElement.Readonly){
						objTextWriter.WriteLine("Readonly:true");
					}else{
						objTextWriter.WriteLine("Readonly:false");
					}
					objTextWriter.WriteLine("},");
					objTextWriter.WriteLine("");
				}
			}
			objTextWriter.WriteLine("};");
			objTextWriter.WriteLine("");
	
			objTextWriter.WriteLine("vm.Buttons={");
			foreach (WebImageButton oElement in objdbToolbar.XWebBTNS.WebButtons)
			{
				if  (oElement.TABLE_COLUMN_NAME!=""){
					objTextWriter.WriteLine(oElement.TABLE_COLUMN_NAME+":{");
					objTextWriter.WriteLine("Title:\""+oElement.Title+"\",");
					objTextWriter.WriteLine("ImageUrl:\""+oElement.ImageUrl+"\",");
					if (oElement.Readonly){
						objTextWriter.WriteLine("Class:\"dbutton\"");
					}else{
						objTextWriter.WriteLine("Class:\"abutton\"");
					}

					objTextWriter.WriteLine("},");
					objTextWriter.WriteLine("");
				}
			}
			objTextWriter.WriteLine("};");
			objTextWriter.WriteLine("");
	
			objTextWriter.WriteLine("});");
			objTextWriter.WriteLine("");
			objTextWriter.WriteLine("avalon.scan();");
			objTextWriter.WriteLine("});");
			objTextWriter.WriteLine("</script>");
			
			oXFinallyBlock.ZZLOGON_SSD=this.ZZLOGON_SSD;
			oXFinallyBlock.DbName=this.DbName;
			oXFinallyBlock.ZZLOGON_LANG  =this.ZZLOGON_LANG;
			oXFinallyBlock.UID_CODE  =this.UID_CODE;
			oXFinallyBlock.APP_PATH  =this.APP_PATH;
			oXFinallyBlock.Trans =this.Trans;
			oXFinallyBlock.Render(objTextWriter);

		}

		private XForm             oXForm;             
		private WebPanels         objWebPanels    = new WebPanels();
		private ZZDocsPermission  _DocsPermission = new ZZDocsPermission();
		private	XStatus           _STATUS_DATA    = new XStatus();
		private	WebLookup         _WebLookup      = new WebLookup();
		private Window            oWindow         = new Window();
		private WebBTNS           objWebBTNS      = new WebBTNS();
		private WebCells          _WebCells       = new WebCells();
		private XFinallyBlock   oXFinallyBlock    = new XFinallyBlock();
		private	XDeclareBlock   objXDeclareBlock  = new XDeclareBlock();

			private WebCaption objECNDTLM_USECURITY_CODE1 =new WebCaption();
					private WebCaption objECNDTLM_USECURITY_CODE2 =new WebCaption();
					private WebCaption objECNDTLM_USECURITY_CODE3 =new WebCaption();
					private WebCaption objECNDTLM_USECURITY_CODE4 =new WebCaption();
					private WebCaption objECNDTLM_USECURITY_CODE5 =new WebCaption();
					private WebCaption objECNDTLM_USECURITY_CODE6 =new WebCaption();
		
		private WebCaption  objECNDTLM_UZADD_DATE      = new WebCaption();
		private WebCaption  objECNDTLM_UZADD_USER      = new WebCaption();
		private WebCaption  objECNDTLM_UZCHG_DATE      = new WebCaption();
		private WebCaption  objECNDTLM_UZCHG_USER      = new WebCaption();
		private WebCaption  objECNDTLM_USECURITY_RIGHT = new WebCaption();
		private WebCaption  objECNDTLM_USTAGE_CODE     = new WebCaption();
		private WebHideBox  objDATA_VFS_UXDIR_CODE           = new WebHideBox();
		private WebCaption  objECNDTLM_XUID_CODE       = new WebCaption();

		private List<AComponent>  _ZZCDFElect     = new List<AComponent>();
		public List<LogisticException> Exceptions = new List<LogisticException>();

		private string  _APP_PATH           = "";
		private string  _ATVT_CODE          = "";
		private string  UID_CODE            = "UID02805B";
		private string  _DbName             = "";
		private string  _DATA_STATUS_CODE   = "NONE";
		private string  _ZZLOGON_LANG       = "";
		private string  _ZZLOGON_SSD        = "";
		private string  _ZZEventOpts        = "";
		private string  _ZZVIEW_MODE_CODE   = "";
		private string  _ZZVIEW_STATUS_CODE = "";
		private string  _ZZMODEL_DATA       = "";
		private string  _ZZEventStatus      = "";
		private string  _ZZEventMode        = "";
		private string  _ZZEventArgs        = "";
		private string  _ZZLOGON_ID         = "";
		private string  _lnk_RW_NO          = "-1";
		private string  _lnk_MODE           = "-1";

		private StreamContext _Trans;
		private Wxf            _Wxf                = new Wxf();
		private XConvert       _Convert            = new XConvert();
		private ZZCaptions     _Captions           = new ZZCaptions();
		private UID02805BE   _UID02805BEntity  = new UID02805BE();

		public UID02805BE Entity { get { return  _UID02805BEntity ; } set { _UID02805BEntity = value; }  }

		public string   lnk_MODE    { get { return _lnk_MODE;       } set { _lnk_MODE       = value; }  }
		public string   lnk_RW_NO   { get { return _lnk_RW_NO;      } set { _lnk_RW_NO      = value; }  }
		public string   ZZLookup    { get { return _WebLookup.Text; } set { _WebLookup.Text = value; }  }
		public Wxf      ZZWxf       { get { return _Wxf;            } set { _Wxf            = value; }  }
		public WebPanels ZZPanels   { get { return objWebPanels;    } set { objWebPanels    = value; }  }
		public WebCells CellsPanel  { get { return _WebCells;       } set { _WebCells       = value; }  }
		public XStatus  STATUS_DATA { get { return _STATUS_DATA;    } set { _STATUS_DATA    = value; }  }

		public string  DbName             { get { return _DbName;             } set { _DbName             = value; }  }
		public string  ZZLOGON_SSD        { get { return _ZZLOGON_SSD;        } set { _ZZLOGON_SSD        = value; }  }
		public string  ZZLOGON_ID         { get { return _ZZLOGON_ID;         } set { _ZZLOGON_ID         = value; }  }
		public string  ZZEventOpts        { get { return _ZZEventOpts;        } set { _ZZEventOpts        = value; }  }
		public string  ZZVIEW_MODE_CODE   { get { return _ZZVIEW_MODE_CODE;   } set { _ZZVIEW_MODE_CODE   = value; }  }
		public string  ZZVIEW_STATUS_CODE { get { return _ZZVIEW_STATUS_CODE; } set { _ZZVIEW_STATUS_CODE = value; }  }
		public string  ZZMODEL_DATA       { get { return _ZZMODEL_DATA;       } set { _ZZMODEL_DATA       = value; }  }
		public string  ZZEventStatus      { get { return _ZZEventStatus;      } set { _ZZEventStatus      = value; }  }
		public string  ZZEventMode        { get { return _ZZEventMode;        } set { _ZZEventMode        = value; }  }
		public string  ZZEventArgs        { get { return _ZZEventArgs;        } set { _ZZEventArgs        = value; }  }
		public string  ZZLOGON_LANG       { get { return _ZZLOGON_LANG;       } set { _ZZLOGON_LANG       = value; }  }
		public string  ATVT_CODE          { get { return _ATVT_CODE;          } set { _ATVT_CODE          = value; }  }
		public string  DATA_STATUS_CODE   { get { return _DATA_STATUS_CODE;   } set { _DATA_STATUS_CODE   = value; }  }
		public string  APP_PATH           { get { return _APP_PATH;           } set { _APP_PATH           = value; }  }

		public StreamContext  Trans              { get { return _Trans;           } set { _Trans           = value; }  }

#region screen element

					private WebTextBox objECNDTLM_ECN_NO =new WebTextBox();

					private WebDigitBox objECNDTLM_SERIAL_NO =new WebDigitBox();

					private WebTextBox objECNDTLM_ECN_DT =new WebTextBox();

					private WebOption objECNDTLM_ECN_ATVT_CODE =new WebOption();

					private WebTextBox objECNDTLM_ASSM_NO =new WebTextBox();
    private WebBrowser objECNDTLM_ASSM_NOBrw =new WebBrowser();

					private WebTextBox objVARIABLE_ASSM_NAME01 =new WebTextBox();

					private WebTextBox objVARIABLE_ASSM_UOM =new WebTextBox();

					private WebTextBox objVARIABLE_ASSM_NAME02 =new WebTextBox();

					private WebTextBox objECNDTLM_ITEM_NO =new WebTextBox();
    private WebBrowser objECNDTLM_ITEM_NOBrw =new WebBrowser();

					private WebTextBox objVARIABLE_ITEM_NAME01 =new WebTextBox();

					private WebTextBox objVARIABLE_UOM_CODE =new WebTextBox();

					private WebTextBox objVARIABLE_ITEM_NAME02 =new WebTextBox();

					private WebFloatBox objECNDTLM_ENG_QPE =new WebFloatBox();

					private WebTextBox objECNDTLM_UOM_ENG =new WebTextBox();
    private WebBrowser objECNDTLM_UOM_ENGBrw =new WebBrowser();

					private WebFloatBox objECNDTLM_UOM_XCHG =new WebFloatBox();

					private WebFloatBox objECNDTLM_QTY_PER =new WebFloatBox();

					private WebFloatBox objECNDTLM_SCRAP_RATE =new WebFloatBox();

					private WebFloatBox objECNDTLM_WASTAGE_RATE =new WebFloatBox();

					private WebTextBox objECNDTLM_ECN_REFX =new WebTextBox();

					private WebTextBox objECNDTLM_ECN_LOCX =new WebTextBox();

					private WebMemoBox objECNDTLM_ECN_RMKS =new WebMemoBox();

#endregion
		const  string ZFILE_NAME   ="UID02805BV";
		const  string MUKI_EDITION ="MIN";

	}
}
